
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>信息列表</title>
</head>
<body>
<form>
   <center>信息列表</center>
    <input  type="button"  value="add" onclick="add()">
    <table width="100%" border=1>
        <tr>
            <td>姓名</td>
            <td>地址</td>
            <td>电话</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${requestScope.list }" var="item">
            <tr>
                <td>${item.name }</td>
                <td>${item.address }</td>
                <td>${item.phone }</td>
                <td><a  href="javascript:void(0)" onclick="edit(${item.id})">修改</a>
                     |
                    <a href="javascript:void(0)" onclick="dele(${item.id})">删除</a>
                </td>
            </tr>
        </c:forEach>

    </table>
</form>
</body>
<script>
    function add() {
         window.location.href="add.jsp"
    }
    function edit(id) {
        window.location.href="show?id="+id ;
    }
    function dele(id) {
        window.location.href="delete?id="+id ;
    }
</script>
</html>


